{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.62 µs ± 5.22 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%%timeit\n",
    "a = [[1.2, 1.5, 1.8],\n",
    "    [1.3, 1.4, 1.9],\n",
    "    [1.1, 1.6, 1.7]]\n",
    "b = [5,10,9]\n",
    "c =[]\n",
    "sum = 0\n",
    "for i in a:\n",
    "    for t in range(3):\n",
    "        sum += i[t]*b[t]\n",
    "    c.append(sum)\n",
    "    sum = 0\n",
    "c\n",
    "            \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3.47 µs ± 12.7 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%%timeit\n",
    "X = np.array([[1.2, 1.5, 1.8], \n",
    "            [1.3, 1.4, 1.9], \n",
    "            [1.1, 1.6, 1.7]]) \n",
    "y = np.array([5, 10, 9]).T \n",
    "sum = np.dot(X,y)\n",
    "sum"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
